$OpenBSD: patch-media_media_gyp,v 1.3 2015/05/26 17:37:40 robert Exp $
--- media/media.gyp.orig.port	Thu May 14 00:35:46 2015
+++ media/media.gyp	Fri May 22 23:54:47 2015
@@ -21,7 +21,7 @@
         'media_use_libvpx%': 1,
       }],
       # Enable ALSA and Pulse for runtime selection.
-      ['(OS=="linux" or OS=="freebsd" or OS=="solaris") and (embedded!=1 or (chromecast==1 and target_arch!="arm"))', {
+      ['(OS=="linux" or OS=="freebsd" or OS=="solaris") and (embedded!=1 or (chromecast==1 and target_arch!="arm")) and os_bsd != 1', {
         # ALSA is always needed for Web MIDI even if the cras is enabled.
         'use_alsa%': 1,
         'conditions': [
@@ -35,6 +35,10 @@
         'use_alsa%': 0,
         'use_pulseaudio%': 0,
       }],
+      # Override to dynamically link the sndio library.
+      ['OS=="openbsd"', {
+        'use_sndioaudio%': 0,
+      }],
       ['sysroot!=""', {
         'pkg-config': '../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
       }, {
@@ -171,6 +175,8 @@
         'audio/pulse/pulse_input.h',
         'audio/pulse/pulse_output.cc',
         'audio/pulse/pulse_output.h',
+        'audio/sndio/sndio_output.cc',
+        'audio/sndio/sndio_output.h',
         'audio/pulse/pulse_util.cc',
         'audio/pulse/pulse_util.h',
         'audio/sample_rates.cc',
@@ -745,6 +751,24 @@
             'filters/h264_bitstream_buffer.h',
           ],
         }],
+        ['use_sndio == 1', {
+          'link_settings': {
+            'libraries': [
+              '-lsndio',
+            ],
+          },
+          'defines': [
+            'USE_SNDIO',
+          ],
+          'sources!': [
+            'audio/linux/audio_manager_linux.cc',
+          ],
+        }, {  # else: use_sndio == 0
+          'sources!': [
+            'audio/sndio/sndio_output.cc',
+            'audio/sndio/sndio_output.h',
+          ],
+        }],
         ['use_alsa==1', {
           'link_settings': {
             'libraries': [
@@ -767,11 +791,21 @@
           ],
         }, {  # else: openbsd==1
           'sources!': [
+            'video/capture/linux/v4l2_capture_delegate.cc',
+            'video/capture/linux/v4l2_capture_delegate.h',
             'video/capture/linux/v4l2_capture_delegate_multi_plane.cc',
             'video/capture/linux/v4l2_capture_delegate_multi_plane.h',
+            'video/capture/linux/v4l2_capture_delegate_single_plane.cc',
+            'video/capture/linux/v4l2_capture_delegate_single_plane.h',
+            'video/capture/linux/video_capture_device_chromeos.cc',
+            'video/capture/linux/video_capture_device_chromeos.h',
+            'video/capture/linux/video_capture_device_factory_linux.cc',
+            'video/capture/linux/video_capture_device_factory_linux.h',
+            'video/capture/linux/video_capture_device_linux.cc',
+            'video/capture/linux/video_capture_device_linux.h',
           ],
         }],
-        ['OS=="linux"', {
+        ['OS=="linux" or OS=="openbsd"', {
           'conditions': [
             ['use_x11==1', {
               'dependencies': [
@@ -862,7 +896,7 @@
             'ozone/media_ozone_platform.h',
           ]
         }],
-        ['OS!="linux"', {
+        ['OS!="linux" and OS!="openbsd"', {
           'sources!': [
             'audio/cras/audio_manager_cras.cc',
             'audio/cras/audio_manager_cras.h',
@@ -1085,7 +1119,7 @@
             'base/simd/convert_yuv_to_rgb_x86.cc',
           ],
         }],
-        ['OS!="linux" and OS!="win"', {
+        ['OS!="linux" and OS!="win" and os_bsd!=1', {
           'sources!': [
             'base/keyboard_event_counter.cc',
             'base/keyboard_event_counter.h',
@@ -1337,7 +1371,7 @@
             'USE_PULSEAUDIO',
           ],
         }],
-        ['os_posix==1 and OS!="mac"', {
+        ['os_posix==1 and OS!="mac" and OS!="openbsd"', {
           'conditions': [
             ['use_allocator!="none"', {
               'dependencies': [
@@ -1884,7 +1918,7 @@
             'test/pipeline_integration_test_base.cc',
           ],
           'conditions': [
-            ['os_posix==1 and OS!="mac"', {
+            ['os_posix==1 and OS!="mac" and OS!="openbsd"', {
               'conditions': [
                 ['use_allocator!="none"', {
                   'dependencies': [
